1. Field of the Invention
This invention relates to computer power control systems and, more particularly, to a central processing unit ("CPU") activity monitor, and a method for monitoring CPU activity.
2. Background of the Invention
Power management systems are commonly used in computers to reduce power consumption. Such power management systems are useful in connection with meeting environmental regulations, reducing operating costs, and extending operating periods of battery-powered, or limited power-source computers. Generally, power management systems reduce the power consumed by inactive components, peripherals and other devices within or connected to the computer. However, to operate efficiently, power management systems need timely information regarding the activity levels of various components.
In order to efficiently control power consumption, power management systems often deactivate unused components, reduce clock speeds, suspend activity, turn inactive components off, etc. Therefore, an efficient power management system needs accurate information regarding the activity status of a particular component. Untimely, or inaccurate information on the activity status of components leads to inefficient power management which can diminish battery life, reduce computer performance, and limit the number of supportable system configurations.
If activity information falsely indicates that a component is active when in fact it is inactive, the power management system fails to reduce power consumption. If activity information falsely indicates that a component is inactive when in fact it is active, the power management system deactivates a needed component, thus slowing system response time.
Generally, power management is a joint effort between software and hardware. Together, the hardware and software form a power management system. Typically the power management software implements the power management strategy of controlling hardware devices. The power management software selects which devices to monitor, monitors system activity, and device activity, and triggers power management functions.
Conventional power management software often monitors accesses to input/output devices, interrupt requests, and memory accesses in order to adjust power consumption rates. In one approach, power management software monitors the accesses to a component or peripheral assigned to a particular memory location. Such memory mapped devices allow the power management software to monitor memory accesses to determine device activity. However, the power management software must know which memory location is assigned to a device. In addition, the power management software must be modified whenever a computer system is reconfigured with different devices.
In addition to software monitoring, hardware can also provide information regarding the usage of the components and peripherals in order to control power consumption. At present, a number of approaches exist in the prior art that measure and control power usage. For example, peripherals, components and other devices have internal power management circuitry that provides activity information. In addition, some peripherals can monitor themselves and deactivate themselves when a period of inactivity occurs. Such self-deactivation is often called a self time-out. Typically, the power management software can access the power management functions of the peripheral and set activity parameters such as the interval for an inactivity time-out.
A device with internal power management functions can also interact with the power management software to provide information on system activity. For example, when a device transitions from an active state to an inactive state, the internal circuitry signals the power management software that the device is inactive. The power management software can reduce the device's clock speed, stop the clock speed, turn the power off, etc. If, on the other hand, a device transitions from an inactive state to an active state, the internal circuitry signals the power management software to activate the device. The power management software can increase the clock speed to the device, restart the clock, turn the power on, etc.
In conventional power management systems, the internal circuitry of a device communicates to the power management software via an interrupt. The internal circuitry of a device generates a power system interrupt when the device transitions from one activity state to another. The power system interrupt, sometimes called a trap, causes the microprocessor to suspend its current operations, save the status of its work, and transfer control to the power system software. The power system software then determines what caused a power system interrupt, obtains the necessary information, and controls hardware devices accordingly.
Many devices such as disk drive controllers, keyboard controllers, and other input/output devices now incorporate internal circuitry to monitor device activity. Therefore, some power management systems allow the monitoring of most peripherals and components. However, conventional power management systems fail to provide accurate information regarding the activity of the central processing unit ("CPU").
The CPU is a significant power consuming device. To control CPU power usage, the power management software needs accurate information about CPU activity. Current methods of obtaining information regarding CPU activity include monitoring interrupts, modem rings and parity errors. However, the CPU can be engaged in active work without communicating via a modem, generating interrupts or generating parity errors. Therefore, a CPU activity monitoring system that only monitors interrupts, modem rings and parity errors can falsely indicate that the CPU is inactive.
Other conventional CPU monitoring devices monitor memory accesses to determine CPU activity. Monitoring of memory accesses can falsely indicate that the CPU is active since accesses to memory can include accesses to the stack, instruction cycles, access to memory mapped input/output devices, and data read/write cycles when the CPU is waiting for a certain event to occur. For example, if the CPU is executing a continuous loop while waiting for some event to happen the CPU could repetitively access the same memory locations for instructions and data. Therefore, in order for memory accesses to provide CPU activity information, the power management software needs to analyze and to bias data accesses appropriately.
In order to determine if the CPU is engaged in useful work, the power management system needs to know when the CPU is executing an "activity event" that signifies a new action by the CPU. The CPU is engaged in useful activity when the CPU does not repetitively access the same memory locations. Therefore it is desirable to differentiate repetitive CPU memory accesses (i.e. accesses to the stack, to the instructions in a repeating routine, or to data locations in a repeating routine) from non-repetitive memory accesses that signify the CPU is engaged in useful activity.
In order to analyze memory accesses, the power management system must track which memory locations the CPU accesses and how often the CPU accesses such locations. Therefore, monitoring memory accesses often requires storing past memory accesses and comparing each new memory access with past memory accesses to determine when the CPU is engaged in productive work. Such an approach requires exclusive CPU processing power and memory.
Other approaches that monitor memory accesses to determine CPU activity require the power management software to know where the stack, operating system, and other frequently used memory locations are located within the CPU memory. However, in this approach the power management software must be configured to the computer and operating system. In addition, the power management software must adapt whenever the computer system is reconfigured.
Furthermore, multi-tasking operating systems complicate the monitoring of memory accesses. Since multi-tasking operating systems often shift applications to different memory locations, the power management software needs additional information from the multi-tasking operating system in order to track repetitive accesses to frequently used memory locations.